﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DO.Domain.AppServices
{
    public class GlobalContext:IGlobalContext
    {
        static readonly Object LocatorLock = new object();

        private static GlobalContext InternalInstance;

        private GlobalContext() { }

        public static GlobalContext GlobalContextInstance()
        {
            if (InternalInstance == null)
            {
                lock (LocatorLock)
                {
                    if (InternalInstance == null)
                    {
                        InternalInstance = new GlobalContext();
                    }
                }
            }

            return InternalInstance;
        }

        #region IGlobalContext Members

        public TransManager.ITransFactory TransactionFactory { get; set; }

        #endregion
    }
}
